<template>
  <main>
    <el-button type="success" @click="open1">打开成功提示1</el-button>
    <el-button type="success" @click="open2">打开成功提示2</el-button>
    <span>{{title}}</span>
    <selectItem></selectItem>
    <input type="text" v-focus/>
  </main>
</template>
<script>
  import focus from '@/directive/focus'
  import selectItem from '@/components/selectItem'

  export default {
    name: 'index',
    beforeMount: function() {

    },
    data () {
      return {
        title: 'index页面'
      }
    },
    methods:{
      open1:function(){
        var _this =  this;
        _this.$emit("openModal","success","打开");
      },
      open2:function(){
        var _this =  this;
        _this.$message({
          type:"success",
          message:"成功打开",
          duration:3000
        });
      },
    },
    directives: {
      focus: focus
    },
    components:{
      selectItem:selectItem,
    },
    mounted:function(){


    },
  }
</script>
<style scoped>
main{
  background: #fff;
}
</style>
